package com.example.ssm1023.config;

public enum ResultCode {

    //基本 正确/错误 处理
    SUCCESS (1000, "操作成功"),
    FAIL (1100, "操作失败"),
    //服务器错误
    ERROR_SERVICE (1201, "服务器异常"),
    //用户相关错误
    FAIL_NULL_USERNAME_OR_PASSWORD (1301, "用户名或密码为空"),
    FAIL_ERROR_USERNAME_OR_PASSWORD (1302, "用户名或密码错误");





    private Integer code;
    private String msg;

    ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    @Override
    public String toString() {
        return "code: " + code + ", msg: " + msg + ". ";
    }
}
